#include <iostream>
#include "./aip-cpp-sdk/speech.h"
#include <jsoncpp/json/json.h>
#include <curl/curl.h>

using namespace std;
using namespace Json;
using namespace aip;



void shibie(void)
{


 // 设置APPID/AK/SK
    std::string app_id = "21673431";
    std::string api_key = "Xu5DH9Ycb4COn5yCLngX7NxS";
    std::string secret_key = "bf0u572eqsMpIruprGvHVhNg3cPbjqSI";

    aip::Speech client(app_id, api_key, secret_key);


    // 无可选参数调用接口
    std::string file_content;
    



    aip::get_file_content("./test.pcm", &file_content);
   // Json::Value result = client.recognize(file_content, "pcm", 16000, aip::null);

    // 极速版调用函数
    // Json::Value result = client.recognize_pro(file_content, "pcm", 16000, aip::null);

    // 如果需要覆盖或者加入参数
    std::map<std::string, std::string> options;
    options["dev_pid"] = "1537";
    Json::Value json = client.recognize(file_content, "pcm", 16000, options);

	//cout<<"result"<<json["err_no"]<<endl;
	cout<<json["result"][0]<<endl;
	//cout<<"resu"

}
int main(void)
{
	shibie();
	return 0;
}
